﻿@model IEnumerable<DCH.Areas.Admin.Models.Player>

@{
    ViewBag.Title = "Index";
}

<h2>Player list</h2>

<p>
    @Html.ActionLink("Create New Player", "Create")
</p>
<table>
    <tr>
         <th>
            Image
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Role)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Matches)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.RunsOrWickets)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.TeamName)
        </th>
       
       
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
           
           <img src="@Url.Content("~/images/player/" + item.image)" alt="Image"  width="50px" height="50px"/>
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Role)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Matches)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.RunsOrWickets)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TeamName)
        </td>
        
        
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ID })
        </td>
    </tr>
}

</table>
